package com.acp.util;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;
/**
 * All rights Reserved, Designed By 姑苏区政府大数据中心
 *
 * @version V1.0
 * @Title: null.java
 * @Package com.dci.controller.construction
 * @Description: 数据源配置
 * @author: 张星亮
 * @date: 2019/4/5
 * @Copyright: 2019 姑苏区政府大数据中心. All rights reserved.
 * 注意：本内容仅限于姑苏区政府大数据中心内部传阅，禁止外泄以及用于其他的商业目
 */
@Configuration
public class DataSourceConfig {

    @Bean(name = "acpDataSource")
    @Primary
    @ConfigurationProperties(prefix = "spring.datasource.acp")
    public DataSource acpDataSource() {
        return DataSourceBuilder.create().build();
    }

    @Bean(name = "acpoDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.acpo")
    public DataSource acpoDataSource() {
        return DataSourceBuilder.create().build();
    }


}
